package org.wanho.mapper;

import org.wanho.entity.User;
import org.wanho.util.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Author：汤小洋
 * Date：2024-12-03 19:07
 * Description：<描述>
 */
public class UserMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs) throws SQLException {
        User user = new User();
        user.setId(rs.getInt("id"));
        user.setName(rs.getString("name"));
        user.setPwd(rs.getString("pwd"));
        user.setAge(rs.getInt("age"));
        user.setSex(rs.getString("sex"));
        user.setHeight(rs.getDouble("height"));
        user.setBirthday(rs.getDate("birthday"));
        return user;
    }
}
